/*
 * Bootstrap Image Gallery JS Demo 3.0.1
 * https://github.com/blueimp/Bootstrap-Image-Gallery
 *
 * Copyright 2013, Sebastian Tschan
 * https://blueimp.net
 *
 * Licensed under the MIT license:
 * http://www.opensource.org/licenses/MIT
 */

/*jslint unparam: true */
/*global blueimp, $ */

var photos = [
{"id":"rome_01","title":"罗马壶"},
{"id":"rome_02","title":"罗马壶"},
{"id":"rome_03","title":"罗马壶"},
{"id":"rome_04","title":"罗马壶"},
{"id":"rome_05","title":"罗马壶"},
{"id":"rome_06","title":"罗马壶"},
{"id":"rome_07","title":"罗马壶"},
{"id":"rome_08","title":"罗马壶"},
{"id":"rome_09","title":"罗马壶"},
{"id":"rome_10","title":"罗马壶"},
{"id":"rome_11","title":"罗马壶"},
{"id":"rome_12","title":"罗马壶"}

]

$(function () {
    'use strict';

    // Load demo images from flickr:
    var linksContainer = $('#links'),
            baseUrl;
	// Add the demo images as links with thumbnails to the page:
	$.each(photos, function (index, photo) {
	    baseUrl = 'img/rome/' + photo.id;
	    $('<a/>')
		.append($('<img>').prop('src', baseUrl + '.jpg').prop('width', 75).prop('height',75))
		.prop('href', baseUrl + '.jpg')
		.prop('title', photo.title)
		.attr('data-gallery', '')
		.append("&nbsp;")
		.appendTo(linksContainer);
	});

    $('#borderless-checkbox').on('change', function () {
        var borderless = $(this).is(':checked');
        $('#blueimp-gallery').data('useBootstrapModal', !borderless);
        $('#blueimp-gallery').toggleClass('blueimp-gallery-controls', borderless);
    });

    $('#fullscreen-checkbox').on('change', function () {
        $('#blueimp-gallery').data('fullScreen', $(this).is(':checked'));
    });

    $('#image-gallery-button').on('click', function (event) {
        event.preventDefault();
        blueimp.Gallery($('#links a'), $('#blueimp-gallery').data());
    });


});
